/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","knockout","promise","ojs/ojanimation"],function(a,g){a.aa={};a.aa.U1={coverStart:{Br:"oj-animation-coverstart",Np:"oj-animation-coverstart",Op:!0},coverUp:{Np:"oj-animation-coverup",Op:!0},fade:{Br:"oj-animation-fade",Np:"oj-animation-fade",Op:!1},pushStart:{Br:"oj-animation-revealstart",Np:"oj-animation-coverstart",Op:!1},pushEnd:{Br:"oj-animation-revealend",Np:"oj-animation-coverend",Op:!1},revealDown:{Br:"oj-animation-revealdown",Op:!1},revealEnd:{Br:"oj-animation-revealend",
Np:"oj-animation-revealend",Op:!1},zoomIn:{Np:"oj-animation-zoomin",Op:!0},zoomOut:{Br:"oj-animation-zoomout",Op:!1}};a.aa.n4=function(a,c,d){var e=$(a);return new Promise(function(a){function b(){a(!0)}var g="oj-"+d,l=g+"-active";e.addClass(c);e.addClass(g);window.requestAnimationFrame(function(){e.addClass(l)});if((g=e.css("animationDuration")||e.css("webkitAnimationDuration"))&&"0s"!=g)e.on("animationend webkitAnimationEnd",b);else if((g=e.css("transitionDuration")||e.css("webkitTransitionDuration"))&&
"0s"!=g)e.on("transitionend webkitTransitionEnd",b);else a(!0)})};a.aa.Ypa=function(b,c,d){var e=[];d=a.aa.U1[d];b&&d&&d.Br&&e.push(a.aa.n4(b,d.Br,"leave"));c&&d&&d.Np&&e.push(a.aa.n4(c,d.Np,"enter"));return Promise.all(e)};a.aa.U3=function(a,c){for(var d=g.virtualElements.firstChild(a);d;)1==d.nodeType?c.push(d):8==d.nodeType&&this.U3(d,c),d=g.virtualElements.nextSibling(d)};a.aa.Fqa=function(a,c){a._ojOldRoot=c};a.aa.bwa=function(a){return a._ojOldRoot};a.aa.sS=function(b){if(b.isInitial)return!1;
if(1==b.node.nodeType)return!0;if(8==b.node.nodeType){var c=[];a.aa.U3(b.node,c);if(c&&1==c.length)return a.aa.Fqa(b,c[0]),!0}return!1};a.aa.z8=function(b){var c;1==b.node.nodeType?c=b.node:8==b.node.nodeType&&(c=a.aa.bwa(b));return c};a.aa.Ay=function(a){var c=$(document.createElement("div")),d={position:"absolute",height:a.offsetHeight+"px",width:a.offsetWidth+"px",left:a.offsetLeft+"px",top:a.offsetTop+"px"};c.appendTo(a.offsetParent);c.css(d);c.addClass("oj-animation-host-viewport");a=document.createElement("div");
a.className="oj-animation-host";c.append(a);return a};a.aa.l6=function(b,c){var d={},e=a.aa.U1[c],f=a.aa.z8(b);e&&(e.Np&&!e.Op&&(d.newViewParent=a.aa.Ay(f)),e.Br&&(d.oldViewParent=a.aa.Ay(f)),e.Np&&e.Op&&(d.newViewParent=a.aa.Ay(f)));return d};a.aa.j6=function(b,c){return a.aa.Ypa(b.oldViewParent,b.newViewParent,c).then(function(){a.aa.kba(b)})};a.aa.hca=function(a,c){var d=a[c];d&&(d=d.parentNode)&&d.parentNode&&d.parentNode.removeChild(d)};a.aa.kba=function(b){b.removeOldView();b.insertNewView();
a.aa.hca(b,"newViewParent");a.aa.hca(b,"oldViewParent")};a.aa.Aq=function(b){return{canAnimate:a.aa.sS,prepareAnimation:function(c){return a.aa.l6(c,b)},animate:function(c){return a.aa.j6(c,b)}}};a.aa.KT=function(b){null==a.aa.GV&&(a.aa.GV=a.Wc.De("oj-animation-navigate-methods"));return a.aa.GV?a.aa.GV[b]:null};a.aa.HAa=function(b,c){return a.aa.KT(c)&&a.aa.sS(b)};a.aa.IAa=function(b,c){var d=a.aa.KT(c);return a.aa.l6(b,d)};a.aa.GAa=function(b,c){var d=a.aa.KT(c);return a.aa.j6(b,d)};a.aa.HJ=function(b){return{canAnimate:function(c){return a.aa.HAa(c,
b)},prepareAnimation:function(c){return a.aa.IAa(c,b)},animate:function(c){return a.aa.GAa(c,b)}}};a.aa.SGa=a.aa.Aq("coverStart");o_("ModuleAnimations.coverStart",a.aa.SGa,a);a.aa.mLa=a.aa.Aq("revealEnd");o_("ModuleAnimations.revealEnd",a.aa.mLa,a);a.aa.TGa=a.aa.Aq("coverUp");o_("ModuleAnimations.coverUp",a.aa.TGa,a);a.aa.lLa=a.aa.Aq("revealDown");o_("ModuleAnimations.revealDown",a.aa.lLa,a);a.aa.X_=a.aa.Aq("zoomIn");o_("ModuleAnimations.zoomIn",a.aa.X_,a);a.aa.Y_=a.aa.Aq("zoomOut");o_("ModuleAnimations.zoomOut",
a.aa.Y_,a);a.aa.DHa=a.aa.Aq("fade");o_("ModuleAnimations.fade",a.aa.DHa,a);a.aa.GKa=a.aa.Aq("pushStart");o_("ModuleAnimations.pushStart",a.aa.GKa,a);a.aa.FKa=a.aa.Aq("pushEnd");o_("ModuleAnimations.pushEnd",a.aa.FKa,a);a.aa.Uia=a.aa.HJ("navChild");o_("ModuleAnimations.navChild",a.aa.Uia,a);a.aa.Via=a.aa.HJ("navParent");o_("ModuleAnimations.navParent",a.aa.Via,a);a.aa.wHa=a.aa.Uia;o_("ModuleAnimations.drillIn",a.aa.wHa,a);a.aa.xHa=a.aa.Via;o_("ModuleAnimations.drillOut",a.aa.xHa,a);a.aa.lKa=a.aa.HJ("navSiblingEarlier");
o_("ModuleAnimations.navSiblingEarlier",a.aa.lKa,a);a.aa.mKa=a.aa.HJ("navSiblingLater");o_("ModuleAnimations.navSiblingLater",a.aa.mKa,a);a.aa.PLa=function(b){return new function(){function c(a){return function(b){return d[a].call(d,b)}}var d,e=this;this.canAnimate=function(f){var g=b(f);d=null==g?null:a.ModuleAnimations[g];if(!d)return!1;for(var g=["prepareAnimation","animate"],k=0;k<g.length;k++){var l=g[k];e[l]=c(l)}return c("canAnimate")(f)}}};o_("ModuleAnimations.switcher",a.aa.PLa,a);a.aa.UGa=
function(b,c,d){return{canAnimate:a.aa.sS,prepareAnimation:function(e){var f={};e=a.aa.z8(e);c&&!d&&(f.newViewParent=a.aa.Ay(e));b&&(f.oldViewParent=a.aa.Ay(e));c&&d&&(f.newViewParent=a.aa.Ay(e));return f},animate:function(d){var f=d.oldViewParent,g=d.newViewParent,k=[];f&&b&&k.push(a.$.ym(f,"close",b));g&&c&&k.push(a.$.ym(g,"open",c));return Promise.all(k).then(function(){a.aa.kba(d)})}}};o_("ModuleAnimations.createAnimation",a.aa.UGa,a)});